package jetpack.com.pzl.architecture.data_binding;

import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import jetpack.com.pzl.databinding.LayoutFragmentABinding;

public class FragmentA extends Fragment {

    LayoutFragmentABinding binding;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        binding = LayoutFragmentABinding.inflate(inflater, container, false);

        new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
            @Override
            public void run() {
                InfoABean infoABean = new InfoABean();
                infoABean.setMessageA("Fragment A it is");
                infoABean.setMessageB("this is a TEXT");
                binding.setInfoA(infoABean);
            }
        }, 2000);

        return binding.getRoot();
    }

    @Override
    public void onResume() {
        super.onResume();
    }


}
